@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx="${basePath}";
	var exwhere = "{parent_user:${pid!}}"
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	var export_source = "user.oraclelist";
	if("${func.isMySql()}" == "true"){
		export_source = "user.mysqllist";
	}
	
	$(function(){
		initGrid();
		initMenuBtn("btns","${code}");
	});
	
	function initGrid(){
		var grid_url = ctx+"/${code}/listMychild";//查询列表接口
		var _colnames=[ "账户", "姓名","电话","创建时间","推荐人ID"];
		var _colmodel=[
						  {name:"ACCOUNT",index:"ACCOUNT", width:80},
						  {name:"NAME",index:"NAME", width:80},
						  {name:"PHONE",index:"PHONE", width:100},
						  {name:"CREATETIME",index:"CREATETIME", width:100},
			{name:"parent_user",index:"parent_user", width:50,formatter:function (value, rows, index) {
				if(value == 0 || value =="" || value == "null" || value == null){
					return "无";
				}else{
					return value;

				}
			}}

						];
		
		jQuery(grid_selector).jqGrid({
			url:grid_url,
			//caption: "用户管理",
		    shrinkToFit:true,//适用于较少字段,响应式
			colNames:_colnames,
			colModel:_colmodel, 
			jsonReader:{id:"ID"},
			pager : pager_selector,
			postData: {
				where:"{parent_user:${pid!}}",
				sort: "status asc, account", order: "asc"
			}
		});
		

	}
	

</script>


	<!-- 配置grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置查询 -->
			@ var _col=[
			@		  	{name:"用户编号",index:"ID",type:"text"},
			@		  	{name:"账户",index:"ACCOUNT",type:"text"},
			@		  	{name:"姓名",index:"NAME",type:"text"},
			@		  	{name:"电话",index:"PHONE",type:"text"}
			@		   ];
			@ include("/common/_function/_search_user.html",{"col":_col}){}
			<!-- 按钮组 -->
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页 -->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入列表页所需js -->
	@include("/common/_listscript.html"){}
@}